import java.util.ArrayList;
import java.util.List;

/**
 * @author dmitry.mamonov
 */

public class ConsumeAllMemory {
    public static void main(String[] args) {
        List<Object> pool = new ArrayList<Object>();
        while(true){
            long start = System.nanoTime();
            pool.add(new byte[1000*1000]);
            long end = System.nanoTime();
            if (end-start>1000000){
                break;
            }
        }
    }
}
